package com.smg.community.service;

import cn.org.rapid_framework.page.Page;
import com.smg.community.dao.SmgMessageDao;
import com.smg.community.model.SmgMessage;
import com.smg.community.vo.query.SmgMessageQuery;
import javacommon.base.BaseManager;
import javacommon.base.EntityDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class SmgMessageManager extends BaseManager<SmgMessage, Integer>
{
  private SmgMessageDao smgMessageDao;

  public void setSmgMessageDao(SmgMessageDao dao)
  {
    this.smgMessageDao = dao; }

  public EntityDao getEntityDao() {
    return this.smgMessageDao;
  }
  
  @Transactional(readOnly=true)
  public Page findPage(SmgMessageQuery query) {
    return this.smgMessageDao.findPage(query);
  }

  public void setMessageIsRead(String ids)
  {  
    this.smgMessageDao.setMessageIsRead(ids); }

  public void deleteReceive(String checkedMessageIds) {
    this.smgMessageDao.deleteReceive(checkedMessageIds); }

  public void deleteSend(String checkedMessageIds) {
    this.smgMessageDao.deleteSend(checkedMessageIds); }

  public int getUnReadMessageCount(int loginMemberId) {
    return this.smgMessageDao.getUnReadMessageCount(loginMemberId);
  }
}